<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui.css">
  <link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css">
  <link rel="stylesheet" type="text/css" href="../css/global.css">
  <script type="text/javascript" src="../js/jquery-3.3.1.js"></script>
  <script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>
  <script type="text/javascript">
		$(function () {
			let datas = [
        {
        	id: '1',
        	text: "选项1"
        },
				{
					id: '2',
					text: "选项2"
				},
				{
					id: '3',
					text: "选项3"
				},
				{
					id: '4',
					text: "选项4"
				},
				{
					id: '5',
					text: "选项5"
				},
      ];

			// let options = "";
			// for (let i = 0; i < datas.length; i++) {
			// 	options += "<option>"+datas[i].text+"</option>"
			// }
			// console.log(options);
			// $("#cc").html("");
      // $("#cc").append(options);

      $("#cc").combobox({
        data: datas,
        onSelect: function (record) {
					console.log(record);
				}
      });
			$("#cc").combobox("setValue", datas[2].id);


		})
  </script>
</head>
<body>

<select style="width: 100px" id="cc" class="easyui-combobox" data-options="valueField:'id',textField:'text'"></select>



</body>

</html>
